package com.example.demo.demos.web.mapper;

import com.example.demo.demos.web.entity.Car;
import com.example.demo.demos.web.entity.Gonggao;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface GonggaoMapper {
    @Select("select * from gonggao where title like concat ('%',#{title},'%') limit #{pageNum},#{pageSize}")
    List<Gonggao> selects(@Param("title") String title, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
    @Select("select count(*) from gonggao  where title like concat('%',#{title},'%')")
    Integer totalcar(@Param("title") String title);
    @Insert("insert into gonggao (title,content,cjr,cjsj) VALUES (#{title},#{content},#{cjr},#{cjsj})")
    Integer addcar(Gonggao gonggao);
    @Update("update gonggao set title=#{title},content=#{content},cjr=#{cjr},cjsj=#{cjsj} where id=#{id}")
    Integer updatecar(Gonggao gonggao );
    @Delete("delete from gonggao where id=#{id}")
    Integer shanchupp(@Param("id") String id);
    @Select("select * from gonggao")
    List<Gonggao> selects1();

}
